- JohnnyCache -

Use JohnnyCache to block access to the disk and memory cache based on
user-defined URL patterns.

Example patterns:

  big_project/dev
  admin/reports/tps
  http://localhost/users/~me/project/dev

This is a useful extension for web developers who want caching disabled on
sites during development, but want to take advantage of content caching for
pre-prod/prod testing and normal browsing.

When a new tab is opened or the address bar changes, the URL in the address
bar is checked against a list of user defined patterns.  If the URL matches
a pattern, the browser prefs:  `browser.cache.disk.enable' and
`browser.cache.memory.enable' are toggled to false.  Otherwise, the cache
is enabled.  If you have the Web Developer extension installed, you can
quickly check the status of cache access by clicking the `Disable' toolbar
item and checking the value of `Disable Cache'.

Much of JohnnyCache is based on AdBlock.  The preferences window and
supporting code were copied nearly verbatim.  Thanks to AdBlock for such a
great example.

It should be pointed out that there are other solutions for cache blocking:

For a long time I used the Web Developer extension and toggled `Disable
Cache' on for development and off for browsing.  Eventually this becomes a
pain in the ass as you'll hit crtl-t, load a site and then watch one
hundred spacer gif's load before you remember that the damn cache is
disabled.

Alternately you can use the profilemanager and MOZ_NO_REMOTE=1 to create an
alternate profile for browsing.  I tried this for a while as well and
finally got frustrated.  External programs that want to open content in the
browser have no idea which profile to choose.  Without skinning the
profiles, its hard to remember which browser window corresponds to which
profile.

With JohnnyCache, I have found that you can just define the URL patterns
for cache blocking and then pretty much forget about it after that.

- Hacking -

+ If preference johnnycache.debug == true; debug messages will print to the
  console.
+ Don't forget to set the johnnycache.debug pref to false before building
  the XPI!

-sboles
